Skip to content

chore: RDS 모듈 제거, ASG capacity 변수화, flaky test 수정#1646

Merged
woowahan-neo merged 7 commits into
mainfrom
chore/remove-rds-terraform
Apr 15, 2026
Merged

chore: RDS 모듈 제거, ASG capacity 변수화, flaky test 수정#1646
woowahan-neo merged 7 commits into
mainfrom
chore/remove-rds-terraform

Conversation

@jaeyeonling
Copy link
Copy Markdown
Contributor

@jaeyeonling jaeyeonling commented Apr 14, 2026

Summary

  • 콘솔에서 삭제된 RDS를 반영하여 Terraform database/secret 모듈 및 관련 참조 제거 (기존 Aurora DB 사용)
  • ASG min_size/max_size/desired_capacity를 모듈 변수로 추출하여 환경별 설정 가능하도록 개선
  • ASG에 lifecycle { ignore_changes = [desired_capacity] } 추가하여 오토스케일링 정책과 충돌 방지
  • RssClientTest를 로컬 XML fixture 기반으로 변경하여 외부 의존성 제거

Changes

Terraform

  • modules/database/, modules/secret/ 디렉토리 삭제
  • environments/dev,prod/main.tf — database 모듈 호출 제거, ASG capacity 변수 전달
  • environments/dev,prod/outputs.tf — database output 제거
  • environments/dev,prod/variables.tf — db_name, db_secret_name 변수 제거
  • modules/application/main.tf — ASG capacity 변수화 + ignore_changes 추가
  • modules/application/variables.tf — asg_min_size, asg_max_size, asg_desired_capacity 변수 추가
  • modules/tags/ — 미사용 database_tags 제거
  • 환경별 설정: dev(min=1, desired=1), prod(min=2, desired=2)

Test

  • RssClientTest — 외부 RSS 피드 호출을 로컬 XML fixture로 대체
  • 테스트용 XML fixture 추가 (tistory-feed.xml, youtube-feed.xml, empty-feed.xml)

Note

  • sonar-build CI 실패는 Gradle 8.10 업그레이드(2025-01-06) 이후 기존부터 발생하던 문제로, 이 PR 범위에서 제외

Test plan

  • RssClientTest 로컬 통과 확인
  • dev 환경 terraform plan 확인
  • 머지 후 GitHub Actions terraform deploy (dev) 실행
  • Bastion EC2 재생성 확인
  • ASG에서 EC2 인스턴스 기동 확인
  • ALB health check 통과 확인

콘솔에서 기존 RDS를 삭제하고 Aurora DB로 전환함에 따라
Terraform에서 database/secret 모듈과 관련 참조를 제거한다.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the database and secret modules from both the development and production environments, along with their associated variables, outputs, and tags. Additionally, the application module's Auto Scaling Group configuration was updated to set the minimum and desired capacity to 1. Feedback was provided regarding the hardcoding of these capacity values, suggesting parameterization to support environment-specific scaling and the use of lifecycle rules to prevent conflicts with auto-scaling policies.

Comment thread terraform/modules/application/main.tf Outdated
Comment on lines +113 to +114
min_size = 1
desired_capacity = 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

ASG의 min_sizedesired_capacity가 모듈 내에 하드코딩되어 있습니다. 이는 다음과 같은 잠재적인 문제를 야기할 수 있습니다:

  1. 환경별 확장성 및 가용성 제한: devprod 환경이 동일한 모듈을 사용하므로, 운영 환경(prod)에서도 인스턴스가 1대로 제한됩니다. 고가용성(HA)을 위해 운영 환경에서는 최소 2대 이상의 인스턴스를 유지하는 것이 권장되므로, 이 값들을 변수화하여 각 환경에서 적절한 값을 전달하도록 개선하는 것이 좋습니다.
  2. 오토스케일링 충돌: desired_capacity를 명시적으로 설정하면, 향후 오토스케일링 정책에 의해 인스턴스 수가 늘어나더라도 terraform apply 실행 시 다시 1대로 줄어드는 현상이 발생합니다. 이를 방지하기 위해 lifecycle 블록에서 ignore_changes = [desired_capacity] 설정을 추가하는 것을 고려해 보시기 바랍니다.

외부 RSS 피드(YouTube, Tistory 등)에 실제 네트워크 호출을 하던
테스트를 로컬 XML fixture로 대체하여 flaky test 문제를 해결한다.
…ges 추가

- min_size, max_size, desired_capacity를 모듈 변수로 추출
- 환경별 적절한 값 설정 (dev: 1, prod: 2)
- lifecycle ignore_changes로 오토스케일링과 terraform apply 충돌 방지
Gradle 8.10에서 deprecated된 JUnitXmlReport.getDestination() API로
인해 sonarqube task가 실패하는 문제를 해결한다.
6.x는 SonarCloud JRE 다운로드 API 호환 문제가 있어
Gradle 8.x 호환되는 5.x 최신 버전으로 변경한다.
SonarCloud CI 실패는 Gradle 8.10 업그레이드 이후 기존부터
발생하던 문제로, 이 PR의 변경 범위에서 제외한다.
@jaeyeonling jaeyeonling changed the title chore(terraform): RDS 모듈 제거 및 ASG capacity 복원 chore: RDS 모듈 제거, ASG capacity 변수화, flaky test 수정 Apr 14, 2026
@woowahan-neo woowahan-neo merged commit 95dab70 into main Apr 15, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants